<?php
include_once 'model/karyawan.php';

$p = $_GET['p'];
$pad = "";
if ($_COOKIE_DATA->type == 1 && $_COOKIE_DATA->asAdmin){	//super user
	if ($p==='karyawan' || $p==='divisi' || $p==='departemen' || $p==='jabatan' || 
		$p==='statusKaryawan' || $p==='golongan'){
		$pad .= "Master :: Karyawan :: ".ucfirst($p);
			
	}
	else if ($p==='rewarddanpunishment' || $p==='prestasipelanggaran' || 
		$p==='detil_prestasipelanggaran' || $p==='nilai') {

		$cc  .= $p==="rewarddanpunishment"? 		"Reward & Punishment" : "";
		$cc  .= $p==="prestasipelanggaran"? 		"Prestasi & Pelanggaran" : "";
		$cc  .= $p==="detil_prestasipelanggaran"? 	"Detil Prestasi & Pelanggaran" : "";
		$cc  .= $p==="nilai"? 						"Nilai" : "";
		
		$pad .= "Master :: Reward & Punishment :: $cc ";
	}		
	else if ($p==='perbuatan' || $p==='ranking') {
		$cc	.= $p==="perbuatan"? ucfirst($p) : "";
		$cc .= $p==="ranking"? 	ucfirst($p) : "";
		
		$pad .= "Transaksi :: $cc";
	}
	else if ($p==='total-point-karyawan' || $p==='total-point-departemen' || $p==='perolehan-reward-punishment' ||
		$p==='total-pelanggaran-departemen' || $p==='prestasi-pelanggaran-per-bidang' || $p==='total-point-perguruan-tinggi' ||
		$p==='reward-punishment-perguruan-tinggi' ) { 
			
		$cc .= $p==='total-point-karyawan'? 			"Total Point Karyawan" : "";
		$cc	.= $p==='total-point-departemen'?			"Total Point Departemen" : "";
		$cc .= $p==='perolehan-reward-punishment'?		"Perolehan Reward Punishment" : "";
		$cc .= $p==='total-pelanggaran-departemen'?		"Total Pelanggaran Departemen" : "";
		$cc .= $p==='prestasi-pelanggaran-per-bidang'?	"Prestasi Pelanggaran per Bidang" : "";
		$cc .= $p==='total-point-perguruan-tinggi'? 	"Total Point Perguruan Tinggi" : ""; 
		$cc .= $p==='reward-punishment-perguruan-tinggi'?"Reward Punishment Perguruan Tinggi" : "";
		
		$pad .= "Laporan Grafik :: $cc";
	}
	else if ($p==='dataUser'){ 
		$pad .= "User Privillage"; 
	}
	else if ($p!==''){
		$pad .= ucfirst($p);
	}
	else{
		$pad .= "Dashboard";
	}
	
	$pad = "<h4 style='display: inline;'>PAGE : $pad</h4>";
}
else{
//	if ($p==='perbuatan') {
//		$pad .= "Perbuatan"; 
//	}
//	else if ($p!==''){
//		$pad .= ucfirst($p);
//	}
//	else{
//		$pad .= "Dashboard"; 
//	}

	
	$kk = mysql_fetch_assoc(kary_load($_COOKIE_DATA->username));
	$pad = "<h4 style='display: inline;'>WELCOME : </h4>".$kk['NAMA_KARYAWAN'];
	$pad .= "<h4 style='display: inline; margin-left:20px'>Last Log : </h4>". date('d-m-Y H:m:s', time());
}

if ($pad) echo $pad;